perm filename TWIN.SAI[USE,CSR]2 blob
sn#518676 filedate 1980-06-30 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 begin "twin" comment read an address file and print pairs of labels
C00005 ENDMK
C⊗;
begin "twin" comment read an address file and print pairs of labels;
require "head[s,les]" source_file;
! break tables;
scnbrk(todot,<".[">,null,"ins");
break(tolff,lf&ff,cr&tab,"is");
scnbrk(foo," ",null,"xr");
string ifile,ofile,txt;
integer col;
string array chunk[1:6];
string proc leftmax(integer maxln; string chop);
return(if ln(chop)≤maxln then chop else chop[1 to maxln]);
! execution;
ofile←ifile←ask("source file=");
ofile←todot(ofile)&".lpt";
txt←lookout(ifile); ! read this file;
entout(ofile); ! and print this one;
! beginning at top of second page;
do begin "loop"
integer testy; ! 0 = undefined, 1 = filled, 2 = need next;
string procedure ADDRESS; begin ! get the next line;
string ns;
if eof then return(null);
case testy of begin
begin "find next"
do begin ns←txt←input(inch,tolff); foo(ns) end until ln(ns) ∨ eof;
testy←2
end "find next";
return(txt);
begin "neednext"
foo(<ns←txt←input(inch,tolff)>);
if ln(ns)=0 then testy←1;
end
end;
return(txt)
end "ADDRESS";
integer row,col;
chunk[1]←left(34,scan(txt,tolff,brk));
testy←2;
for row←2 thru 6 do chunk[row]←left(34,address);
testy←0;
for row←1 thru 6 do cprint(ouch,chunk[row]," ",leftmax(34,address),↓);
testy←0; address;
end "loop" until eof;
release(inch);
release(ouch);
loded("ftp {score/csd.stanley}labels.lpt←labels.lpt
");
end